<?php

namespace App\Modules\Apicrzs\Services\Tools;

use App\Modules\Admin\Entities\Member\BankModel;
use App\Modules\Admin\Entities\Vip\VipModel;
use App\Modules\Admin\Services\BaseService;

class BankServices extends BaseService
{
    public function __construct(BankModel $model)
    {
        $this->model = $model;
    }
    public function lists(array $params) : array
    {
        $params['where_callback'] = function($query) use ($params){
            // 按照名称进行搜索
            $query->where('is_check', 1);
        };
        return parent::lists($params); // TODO: Change the autogenerated stub
    }

    /**
     * @return array
     */
    public function getList(): array
    {
        return $this->model->where(['is_check'=> 1])->get(['id','name','code','icon'])->toArray();
    }
}
